<%-- 
    Document   : databaseJadwalPemesanan
    Created on : Nov 10, 2011, 10:44:58 PM
    Author     : Renaldo Malau
--%>

<%@page import="javax.swing.JOptionPane"%>
<%@page import="java.sql.Statement"%>
<%@page import="databaseConnection.DatabaseConnection"%>
<%@page import="java.sql.SQLException"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            try {
                DatabaseConnection conn = new DatabaseConnection();
                Statement st = conn.connection.createStatement();
                if (request.getParameter("update").equalsIgnoreCase("pesan") || request.getParameter("update").equalsIgnoreCase("pesan DP")) {
                    st.executeUpdate("update datatamu set statusPembayaran='"+request.getParameter("update") +"' where noTeleponTamu='"+request.getParameter("telepon") +"'");
                } else if (request.getParameter("update").equalsIgnoreCase("hapus")) {
                    st.executeUpdate("delete from datatamu where noTeleponTamu='"+request.getParameter("telepon") +"'");
                } else {
                    JOptionPane.showMessageDialog(null, "unknow command");
                }
                response.sendRedirect("lihat&UpdateTamu.jsp");
            } catch (Exception ex) {
            }
        %>
    </body>
</html>
